package fausto.cycles 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	/**
	 * ...
	 * @author Ben.
	 */
	public class CyclesItem extends Sprite
	{
		public var _titleTxt:TextField
		public var _id:int
		
		public function CyclesItem(_s:String, _i:int):void 
		{
			_id = _i;
			_titleTxt.width = 120;
			_titleTxt.autoSize = TextFieldAutoSize.CENTER;
			
			_titleTxt.htmlText = "./ "+_s;
			
			mouseChildren = false;
			buttonMode = true;
			//_titleTxt.y = Math.round((120 - _titleTxt.textHeight) / 2);
			
			addEventListener(MouseEvent.ROLL_OVER, onOver);
			addEventListener(MouseEvent.ROLL_OUT, onOut);
			addEventListener(MouseEvent.CLICK, onClick);
		}
		
		private function onClick(e:MouseEvent):void 
		{
			dispatchEvent(new Event("CYCLES_ITEM_THUMB", true));
		}
		
		private function onOut(e:MouseEvent):void 
		{
			
		}
		
		private function onOver(e:MouseEvent):void 
		{
			
		}
		
	}

}